var common = require('./common.js').default;
var api = new function() {
    this.setConfig = function(config) {
        this.config = config;
        var baseUrl = config.base_url;
        if(process.env.NODE_ENV == "dev"){
             baseUrl= "/api";
        }
        this.getQRCode = baseUrl + "/user/getQRCode" //获取小程序二维码
        //个人登录
        this.verifyCode = baseUrl + "/verifycode/710a7ac1235b42d681863bdc2b2022d4.jpg";
        this.register = baseUrl + "/user/register/{telephone}/{identity}/{v_token}";
        this.loginOut = baseUrl + "/user/loginOut"; //退出登录
        this.login = baseUrl + "/user/login/{=telephone}/{=v_token}";
        this.resetPwd = baseUrl + "/user/resetPwd/{telephone}/{v_token}";
        this.getNewToken = baseUrl + "/user/getNewToken"; //获取新的token
        this.savePicture = baseUrl + "/user/savePicture"; //实名认证提交

        //企业登录
        this.companyLogin = baseUrl + "/company/login/{telephone}";
        this.loginOutAdmin = baseUrl + "/user/loginOutAdmin"; //企业后台退出登录
        this.companyRegister = baseUrl + "/company/register";
        this.companyResetPwd = baseUrl + "/company/resetPwd/{telephone}";
        this.getCityRepositoryList = baseUrl + "/company/getCityRepositoryList";

        //获取验证码
        this.getVerifyCodeForget = baseUrl + "/verifycode/getVerifyCodeForget/{telephone}";
        this.getVerifyCodeRegister = baseUrl + "/verifycode/getVerifyCodeRegister/{telephone}";
        this.getVerifyCodeRealAuth = baseUrl + "/verifycode/getVerifyCodeRealAuth/{telephone}";
        this.getVerifyCodeUpdatePwd = baseUrl + "/verifycode/getVerifyCodeUpdatePwd";

        //index
        this.getProcedureConfig = baseUrl + "/index/getProcedureConfig";
        this.getProjects = baseUrl + "/index/getProjects"; //获取首页特种工和继续教育报名字段
        this.getNewsList = baseUrl + "/news/getNewsList/{=newsType}";
        this.getNews = baseUrl + "/news/getNews/{id}";

        //个人中心

        this.addUserInfo = baseUrl + "/user/addUserInfo/{telephone}";//实名认证
        this.getMyInfo = baseUrl + "/user/getMyInfo";
        this.delApply = baseUrl + "/apply/delApply/{tradeNo}";
        this.getApplyInfo = baseUrl + "/apply/getApplyInfo";
        this.lookInvoice = baseUrl + "/invoice/myview/{tradeNo}"; //查看发票
        this.lookCertificate = baseUrl + "/certificate/{applyid}"; //查看证书
        this.resetPsersonPwd = baseUrl + "/user/resetPsersonPwd/{v_token}"; //个人中心修改密码
        this.getMyLessonCertificates = baseUrl + "/user/getMyLessonCertificates/{tradeNo}"; //查看面授听课证
        // this.completeUserInfo = baseUrl + "/user/completeUserInfo"; //确认实名
        this.getVerifyCodeChangeTelephone = baseUrl + "/verifycode/getVerifyCodeChangeTelephone/{telephone}"; //更换手机号验证码
        this.getVerifyCodeFeedBack = baseUrl + "/verifycode/getVerifyCodeFeedBack";
        this.feedback = baseUrl + "/user/feedback/{code}/{v_token}";
        this.getMyCertificate = baseUrl + "/certificate/getMyCertificate"; //获取证书
        this.changeTelephone = baseUrl + "/user/changeTelephone/{v_token}"; //更换手机号
        this.refund = baseUrl + "/refund/applyWithRefund/{tradeNo}"; //申请退费
        this.applyChangeCompany = baseUrl + "/user/applyChangeCompany"; // 修改企业
        this.getEmailList = baseUrl + "/email/getEmailList";//下载中心
        this.applyChangeUserName = baseUrl + "/user/applyChangeUserName";//申请修改姓名changeName
        this.selectTransacationList = baseUrl + "/transacation/selectTransacationList";//业务中心
        this.delTransactionFlow = baseUrl + "/user/delTransactionFlow/{transactionNo} ";


        this.viewCertificate = baseUrl + "/certificate/{applyid}";
        this.myview = baseUrl + "/invoice/myview/{tradeNo}";

        //个人二建报名
        this.getCombApply = baseUrl + "/combApply/getCombApply"; //报名第一步组合接口
        this.getType = baseUrl + "/type/getType/{projectCode}";
        this.launchApplyTrade = baseUrl + "/apply/launchApplyTrade/{type}/{productId}/{invoiceTempId}"
        this.delCompanyApply = baseUrl + "/compayApply/delCompanyApply/{tradeNo}" //删除报名未付款订单

        //特种工报名
        this.getTzgProductPrice = baseUrl + "/apply/getTzgProduct/{type}"
        this.merchantApplyToSubmit = baseUrl + "/compayApply/merchantApplyToSubmit" //maps

        //企业二建特种工报名
        this.getMerchantNoTradeApply = baseUrl + "/compayApply/getMerchantNoTradeApply"
        this.getCertificates = baseUrl + "/certificate/getCertificatesByUid" //特种工获取证书
        this.merchantApply = baseUrl + "/compayApply/merchantApply/{type}" //企业校验数据成功失败多少

        //在线查询
        this.searchPersonCertificate = baseUrl + "/certificate/searchPersonCertificate/{identity}";
        this.searchCompanyCertificate = baseUrl + "/certificate/searchCompanyCertificate";

        //任务界面
        this.getMyApplySuccess = baseUrl + "/apply/getMyApplySuccess"; //获取专业
        this.getCourses = baseUrl + "/course/getCourses/{applyId}"; //获取课时
        this.chooseCourse = baseUrl + "/course/chooseCourse/{applyId}"; //获取课时后确定
        this.getTasks = baseUrl + "/task/getTasks/{tradeNo}/{classType}"; //获取任务列表
        this.getDetail = baseUrl + "/course/getDetail/{courseId}";

        //保存视频
        this.saveVideoPlayRecord = baseUrl + "/play/saveVideoPlayRecord/{vid}/{courseId}/{rid}/{playTime}"; //提交视频进度
        this.saveVideoFinish = baseUrl + "/course/saveVideoFinish/{vid}/{cid}/{rid}"; //提交视频

        //考试
        this.getExam = baseUrl + "/question/getExam/{productId}/{examId}";
        this.saveItem = baseUrl + "/question/saveItem/{rid}/{itemid}";
        this.submit = baseUrl + "/question/submit/{rid}";

        this.refundWithServicePrice = baseUrl + "/refund/refundWithServicePrice/{tradeKid}/{tradeNo}";
        this.getUsersApplyByTradeNo = baseUrl + "/apply/getUsersApplyByTradeNo/{tradeNo}"; //根据订单号获取报名人数

        //发起支付
        this.flow_order = baseUrl + "/pay/flow_order/{tradeNo}";
        this.zhifubaotradeNo = baseUrl + "/pay/zhifubao/{tradeNo}"
        //other
        this.getInvoiceInfo = baseUrl + "/invoice/getInvoiceInfo/{tradeNo}"; //发票信息

        //体检预约
        this.getHospitals = baseUrl + "/hospital/getHospitals" //体检预约
        this.saveAppointmentNew = baseUrl +
            "/hospital/saveAppointmentNew/{applyId}/{hospitalId}/{appointmentTimeType}" //体检预约提交
        this.getMyAppointment = baseUrl + "/hospital/getMyAppointment/{applyId}" //获取体检预约

        //发票列表
        this.saveInvoiceTemp = baseUrl + "/invoice/saveInvoiceTemp" //发票新增保存
        this.delInvoiceTemp = baseUrl + "/invoice/delInvoiceTemp/{id}" //发票删除
        this.getInvoiceTemp = baseUrl + "/invoice/getInvoiceTemp" //发票获取list
        this.getInvoiceTempById = baseUrl + "/invoice/getInvoiceTempById/{id}" //获取单个发票
        this.comfirmTrade = baseUrl + "/pay/comfirmTrade/{tradeNo}/{invoiceTempId}/{invoiceType}" //发票确认订单
        this.confirm_order = baseUrl + "/pay/confirm_order/{kid}/{tradeNo}" //确认订单
        this.updateInvoiceInfo = baseUrl + "/invoice/updateInvoiceInfo/{tradeNo}/{dataInvoiceTempId}" //修改发票

        // 三类报名
        this.getSlryListInfo = baseUrl + "/threeType/getListInfo" //获取三类列表
        this.getProductByCertificateName = baseUrl + "/threeType/getProductByCertificateName" //projectCode certificateName
        // this.getCompanyThreeApply = baseUrl + "/threeType/companyThreeApply" //企业个人获取列表identityCode
        this.getSlryLessonCertificates = baseUrl + "/user/getSlryLessonCertificates/{tradeNo}" //企业个人获取列表identityCode


        this.getTicketByIdentityCode = baseUrl + "/tzgPractical/getTicketByIdentityCode/{v_token}" //identityCode
        this.fileManagerUpload = baseUrl + "/fileManager/uploadFile/{v_token}/{type}"
        this.uploadFile = baseUrl + "/fileManager/upFile"
        this.getVerifyCodeLogin = baseUrl + "/verifycode/getVerifyCodeLogin/{telephone}"
        this.getUploadFileCheckPass = baseUrl + "/fileManager/getUploadFileCheckPass/{pageNo}/{pageSize}"
        this.getVerifyCodeUploadFile = baseUrl + "/verifycode/getVerifyCodeUploadFile/{telephone}"


        this.tzgNetLaunchApplyTrade = baseUrl + "/apply/tzgNetLaunchApplyTrade/{productId}/{invoiceTempId}"//特种工网教报名

    }
}

module.exports = api
